import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/method")
public class MethodServlet extends HttpServlet {
       @Override
       protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              System.out.println("post");
              resp.getWriter().write("doPost") ;
       }
       @Override
       protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              System.out.println("Get");
              resp.getWriter().write("doGet") ;
       }
       @Override
       protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              System.out.println("Put");
              resp.getWriter().write("Put") ;
       }
       @Override
       protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              System.out.println("Delete");
              resp.getWriter().write("doDelete") ;
       }
}
